<?php
$messages = $this->requestAction('/messages/search');
for($i = 0; $i < count($messages); $i++)
{
?>
    <div class="span-24 last <? echo ($messages[$i]['Message']['status'] == 1)?"message":"error-message"; ?>">
        <?=  $messages[$i]['Message']['message']?>
    </div>
<?php
}

$this->requestAction('/messages/deleteall');
?>
